< previous page page_457 next page >

Page 457
Summary..
In this chapter, you saw what goes into making your application error free. But, as you well know, there is no such thing as an error-free application. The errors that can occur in the application, and how you handle them, is one of the last major design issues that you must deal with for your application. When designing the error-handling routines, the more time you spend anticipating errors that might occur, the better your application will be. It all depends on how good you want the application to appear to the user. If an error occurs, do you want the user to possibly lose hours of work, or maybe lose important data? Hopefully the answer to both is no.
By coding routines that handle any error that might happen, you are making the application easier to use. You have seen how to use the statements and objects provided by Visual Basic to process the errors and maintain the error-handling routines. In addition, you have learned how to force an error to occur in order to test the error routines that you have created. Finally, using the same Visual Basic methods, you can create your own errors in the application to process any logic errors that you want to handle as an error.
Q&A
Q What types of errors can be fixed in order for the program to continue?
A The errors that can be fixed during execution of the application are usually ones that are non-destructive. This means that the error has not caused any data problems. An example of a fixable error is Disk Not Ready.
Q What does an On Error command do?
A The On Error statement gives you the ability to control the error-handling process.
Q What is an Err object?
A The Err object contains information about an error that has just occurred.
Workshop
The Workshop provides quiz questions to help solidify your understanding of the material covered, as well as exercises to provide you with experience in using what you've learned. Try to understand the quiz and exercise answers before continuing on to the next day's lesson. Answers are provided in Appendix A, Answers to Exercises.

 
< previous page page_457 next page >

If you like this book, buy it!